package com.clz.hyperit.service;

import java.util.List;

import com.clz.hyperit.entity.Article;
import com.clz.hyperit.entity.ArticleTag;
import com.clz.hyperit.entity.Question;
import com.clz.hyperit.entity.Tag;
import com.clz.hyperit.vo.PageInfo;

public interface TagService {

	public Tag getByName(String name);
	
	public Tag findById(Integer id);

	public Integer saveTag(Tag tag);

	public void deleteTag(Tag tag);

	public void updateTag(Tag tag);

	public List<Tag> findTag();
	//保存articleTag
	public List<Integer> saveTagArticle(Integer article_id, String name);
	//根据文章ID查找标签
	public List<Tag> findTagByArticle(Integer id);
	//删除相关文章的标签关联
	public void deleteByArticle(Integer id);
	//保存questionTAG
	public List<Integer> saveTagQuestion(Integer question_id, String tag);
	//根据问题ID查找标签
	public List<Tag> findTagByQuestion(Integer id);
	//根据标签找到文章
	public List<Article> getArticle(Integer tag_id, PageInfo pageInfo);
	//根据标签找到问题
	public List<Question> getQuestion(Integer question_id, PageInfo pageInfo);
	//根据阅读量排序标签
	public List<Tag> findTagByReading(PageInfo pageInfo);
	//根据时间排序
	public List<Tag> findTagByTime(PageInfo pageInfo);
	//搜索
	public List<Tag> findTagBySearch(PageInfo pageInfo, String tag);
	//根据文章数量排序
	public List<Tag> findTagByArticleNum(PageInfo pageInfo);
	//根据问题数量排序
	public List<Tag> findTagByQuestionNum(PageInfo pageInfo);
}
